package com.ruoyi.examination.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.examination.vo.ExaminationVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.examination.mapper.ExaminationMapper;
import com.ruoyi.examination.domain.Examination;
import com.ruoyi.examination.service.IExaminationService;
import com.ruoyi.common.core.text.Convert;

/**
 * 参试设备Service业务层处理
 * 
 * @author mqs
 * @date 2024-05-03
 */
@Service
public class ExaminationServiceImpl implements IExaminationService 
{
    @Autowired
    private ExaminationMapper examinationMapper;

    /**
     * 查询参试设备
     *
     * @param examinationId 参试设备主键
     * @return 参试设备
     */
    @Override
    public ExaminationVO selectExaminationByExaminationId(Long examinationId)
    {
        return examinationMapper.selectExaminationByExaminationId(examinationId);
    }

    /**
     * 查询参试设备列表
     *
     * @param examinationVO 参试设备
     * @return 参试设备
     */
    @Override
    public List<ExaminationVO> selectExaminationList(ExaminationVO examinationVO)
    {
        return examinationMapper.selectExaminationList(examinationVO);
    }

    /**
     * 新增参试设备
     *
     * @param examination 参试设备
     * @return 结果
     */
    @Override
    public int insertExamination(Examination examination)
    {
        examination.setCreateTime(DateUtils.getNowDate());
        return examinationMapper.insertExamination(examination);
    }

    /**
     * 修改参试设备
     *
     * @param examination 参试设备
     * @return 结果
     */
    @Override
    public int updateExamination(Examination examination)
    {
        examination.setUpdateTime(DateUtils.getNowDate());
        return examinationMapper.updateExamination(examination);
    }

    /**
     * 批量删除参试设备
     *
     * @param examinationIds 需要删除的参试设备主键
     * @return 结果
     */
    @Override
    public int deleteExaminationByExaminationIds(String examinationIds)
    {
        return examinationMapper.deleteExaminationByExaminationIds(Convert.toStrArray(examinationIds));
    }

    /**
     * 删除参试设备信息
     *
     * @param examinationId 参试设备主键
     * @return 结果
     */
    @Override
    public int deleteExaminationByExaminationId(Long examinationId)
    {
        return examinationMapper.deleteExaminationByExaminationId(examinationId);
    }


    @Override
    public int outbound(String examinationIds) {
        return examinationMapper.outbound(Convert.toStrArray(examinationIds));
    }

    @Override
    public int input(String examinationIds) {
        return examinationMapper.input(Convert.toStrArray(examinationIds));
    }

    @Override
    public int out(String examinationIds) {
        return examinationMapper.out(Convert.toStrArray(examinationIds));
    }

    @Override
    public int entrance(Examination examination) {
        return examinationMapper.entrance(examination);
    }

    @Override
    public Long selectNumByStoreId(Long storeId) {
        return examinationMapper.selectNumByStoreId(storeId);
    }
}
